home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / controls / circle / circle~1.h < prev    next >
Text File  |  1995-11-25  |  3KB  |  115 lines

  1. //=--------------------------------------------------------------------------=
  2. // CircleCtl.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // class declaration for the Circle control.
  13. //
  14. #ifndef _CIRCLECONTROL_H_
  15.  
  16. #include "IPServer.H"
  17. #include "CtrlObj.H"
  18. #include "CircleInterfaces.H"
  19. #include "Dispids.H"
  20.  
  21. typedef struct tagCIRCLECTLSTATE {
  22.  
  23.     // TOOD: put state variables here, and probably get rid of fGarbage, unless
  24.     // you have a real need for it
  25.     //
  26.     VARIANT_BOOL fGarbage;
  27.  
  28. } CIRCLECTLSTATE;
  29.  
  30. //=--------------------------------------------------------------------------=
  31. // CCircleControl
  32. //=--------------------------------------------------------------------------=
  33. // our control.
  34. //
  35. class CCircleControl : public COleControl, public ICircle, public ISupportErrorInfo {
  36.  
  37.   public:
  38.     // IUnknown methods
  39.     //
  40.     DECLARE_STANDARD_UNKNOWN();
  41.  
  42.     // IDispatch methods
  43.     //
  44.     DECLARE_STANDARD_DISPATCH();
  45.  
  46.     // ISupportErrorInfo methods
  47.     //
  48.     DECLARE_STANDARD_SUPPORTERRORINFO();
  49.  
  50.     // ICircle methods
  51.     //
  52.     // TODO: copy over the method declarations from CircleInterfaces.H
  53.     //       don't forget to remove the PURE from them.
  54.     //
  55.     STDMETHOD_(void, AboutBox)(THIS);
  56.  
  57.     // OLE Control stuff follows:
  58.     //
  59.     CCircleControl(IUnknown *pUnkOuter);
  60.     virtual ~CCircleControl();
  61.  
  62.     // static creation function.  all controls must have one of these!
  63.     //
  64.     static IUnknown *Create(IUnknown *);
  65.  
  66.   private:
  67.     // overridables that the control must implement.
  68.     //
  69.     STDMETHOD(LoadBinaryState)(IStream *pStream);
  70.     STDMETHOD(SaveBinaryState)(IStream *pStream);
  71.     STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
  72.     STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
  73.     STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
  74.     virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  75.     virtual BOOL    RegisterClassData(void);
  76.  
  77.     virtual HRESULT InternalQueryInterface(REFIID, void **);
  78.     virtual void    BeforeCreateWindow(void);
  79.     virtual HRESULT DoCustomVerb(LONG lVerb);
  80.  
  81.     // private state information.
  82.     //
  83.     CIRCLECTLSTATE m_state;
  84. };
  85.  
  86.  
  87. // TODO: if you have an array of verbs, then add an extern here with the name
  88. //       of it, so that you can include it in the DEFINE_CONTROLOBJECT.
  89. //       ie.  extern VERBINFO m_CircleCustomVerbs [];
  90. //
  91. extern VERBINFO rgCircleCustomVerbs [];
  92.  
  93. DEFINE_CONTROLOBJECT(Circle,
  94.     &CLSID_Circle,
  95.     "CircleCtl",
  96.     CCircleControl::Create,
  97.     1,
  98.     &IID_ICircle,
  99.     "Circle.HLP",
  100.     &DIID_DCircleEvents,
  101.     OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
  102.     RESID_TOOLBOX_BITMAP,
  103.     "CircleWndClass",
  104.     0,
  105.     NULL,
  106.     1,
  107.     rgCircleCustomVerbs);
  108.  
  109.  
  110.  
  111. #define _CIRCLECONTROL_H_
  112. #endif // _CIRCLECONTROL_H_
  113.  
  114.  
  115.